package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-08
 * Time: 17:54
 */
public class BookList {
    private Book[] books;
    private int usedSize;

    public BookList() {
        this.books = new Book[10];//注意先初始化
        this.books[0]=new Book("活着","余华",30,"小说");
        this.books[1]=new Book("十宗罪","蜘蛛",25,"小说");
        this.books[2]=new Book("追风筝的人","卡勒德",40,"小说");

        this.usedSize=3;
    }

    public Book[] getBooks() {
        return books;
    }

    public Book getBooks(int pos){
        return books[pos];
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }

    public void setBooks(Book book,int pos){
       this.books[pos]=book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
